<template>
  <div v-if="bol" id="app">
    <!-- <button @click="btnClick">获取当前路由信息</button> -->
    <router-view />
    <router-view name="xxx" />
  </div>
</template>

<script>
export default {
  name: 'App',
  provide() {
    return {
      // abc无法获取与修改 通过this都无法访问
      abc: this.xxx,
      that: this,
      reload: this.reload
    }
  },
  data() {
    return {
      xxx: {
        name: '67期'
      },
      bol: true
    }
  },
  watch: {
    $route(newVal) {
      // console.log('watch', newVal)
    }
  },
  methods: {
    reload() {
      this.bol = false
      this.$nextTick(() => {
        this.bol = true
      })
    }
  }
  // created() {
  //   console.log('route', this.$route)
  // },
  // methods: {
  //   btnClick() {
  //     console.log('route', this.$route)
  //   }
  // }
}
</script>
